package com.example.evanproject.mapper;

import com.example.evanproject.domain.Courselesson;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

/**
* @author hanxiaoqi
* @description 针对表【courselesson】的数据库操作Mapper
* @createDate 2024-03-09 21:52:12
* @Entity generator.domain.Courselesson
*/
@Mapper
public interface CourselessonMapper extends BaseMapper<Courselesson> {

    @Select("select * from courselesson where ls_id=#{id}")
    Courselesson selectbyid(Integer id);



    @Insert("insert into courselesson (mo_id,ls_name) values (#{moId},#{lsName})")
    @Options(useGeneratedKeys=true, keyProperty="lsId", keyColumn="ls_id")
    Integer addcourselesson(Courselesson courseLesson);
    /*添加课时信息(就是在课时的那个id 修改内容)*/
//     上传富文本
    @Update("UPDATE courselesson set ls_text=#{text},ls_way=2 where ls_id=#{lsId}")
    Integer addlessoninfo(Integer lsId, String text);


    //    上传视频(不用考虑上传两个不同类型 因为前端会根据类型展示 这里修改了类型)
    @Update("UPDATE courselesson set ls_vido=#{voidename},ls_way=#{type} where ls_id=#{lessonid}")
    Integer updateviod(@Param("voidename") String voidename, @Param("lessonid") Integer lessonid,@Param("type") Integer type);
    @Update("UPDATE courselesson set ls_file=#{voidename},ls_way=#{type} where ls_id=#{lessonid}")
    Integer updateFile(@Param("voidename") String voidename, @Param("lessonid") Integer lessonid,@Param("type") Integer type);
}




